unit wgeterda;

{****************************************************************************}

interface

uses Wincrt,Windos,
      CartoCmds,        (* Contient les def. globales *)
      tit_win,get_win,gmuf_win,aux_win,coul_win;


(*************************** gethff - 3 Nov 90 *****************************)

function get_erdas(nomsc:st64;var FormatType, nbands, nlig_capt,ncol_capt : word): integer;

{****************************************************************************}

implementation

(*************************** getbmp - 5 Juin 91 *****************************)

function get_erdas(nomsc:st64;var FormatType, nbands, nlig_capt, ncol_capt : word): integer;

const
     card_capt = 8;

var   ier,i,l,k,n:integer;

      erdas:file;
      buf_erdas:array[1..512] of integer;
      char_erdas:array[1..512] of char;
      _nlig,_ncol : longint;

label 999;

begin

  get_erdas := 1;

  ncol_capt := 0;
  nlig_capt := 0;

  {$I-}

  assign(erdas,nomsc);
  reset(erdas,1);
  if ioresult <> 0 then begin get_erdas := -1; goto 999; end;

(* Standard Header *)
  blockread(erdas,char_erdas,6);
  strw := ''; for i := 1 to 6 do strw := strw+char_erdas[i];
(*  writeln('Header : ',strw);  *)

(* Data Type *)
  blockread(erdas,FormatType,2);
(*  writeln('DataType : ',FormatType); *)

(* Nbands *)
  blockread(erdas,nbands,2);
(*  writeln('Nbands : ',nbands); *)
  blockread(erdas,char_erdas,6); (* Skip *)

(* Nbcols *)
  blockread(erdas,_ncol,4);
  ncol_capt := _ncol;
(*  writeln('ncol_capt : ',ncol_capt); *)

(* Nlines *)
  blockread(erdas,_nlig,4);
  nlig_capt := _nlig;
(*  writeln('nlig_capt : ',nlig_capt); *)

  close(erdas);
  get_erdas := 0;

999:end;

end.

